import java.util.concurrent.atomic.AtomicInteger;

public class Thread2 {
    public static void main(String[] args) {
        AtomicInteger count=new AtomicInteger(0);
        Thread[]t=new Thread[20];
        int c=0;
        for(int i=0;i<20;i++)
        {
            t[i]=new Thread(new Runnable() {
                @Override
                public void run() {
                    //count.getAndIncrement();
                   //c++;

                }
            });
        }
        for(Thread a:t)
        {
            a.start();
        }
        for(Thread a:t)
        {
            try {
                a.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
        System.out.println(count);

    }
}
